import { Link } from 'libframe-docs/components'

Environment: `Browser`.

The `getPage()` function allows us to access the [`pageContext`](/pageContext) in the browser.

> When we use `getPage()`, we essentially do <Link href="/server-routing" text="Server-side Routing" />.

```js
// *.page.client.js
// Environment: Browser

import { getPage } from 'vite-plugin-ssr/client'

hydrate()

async function hydrate() {
  const pageContext = await getPage()

  // We can now hydrate our page using `pageContext.Page`
  // ...
}
```

The `pageContext` returned by `getPage()` is a subset of the `pageContext` defined on the server-side; to determine what `pageContext` is sent to the browser we use [`passToClient`](/passToClient).

The `pageContext` is serialized and passed from the server to the browser with [`json-s`](https://github.com/brillout/json-s).

> In production, the `pageContext` is prefetched and `getPage()` merely makes it available.

## See also

 - <Link href="/data-fetching" />
 - <Link href="/hydration" />
